import React, { Component } from 'react';
import '../styles/Mylist.scss'
import pic from  '../assets/1.jpg'

class Mylist extends Component {
    constructor(props){
        super(props);
        this.state = { //state中保存的值就是组件的状态
            list:[
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
                { pic,text:'cOSME DECORTE黛珂植物欣韵沁莹化妆水20...',money:'￥200', activity:'￥195'} ,
            ]
        }
    }
    render() {
        return (
            <div className='Mylist' >
                   {
                    this.state.list.map((item,index)=>{
                      return(
                        <div className="item" key={index}>
                              <img src={item.pic} alt="" />
                        <div className="text">{item.text}</div>
                        <div className="money">{item.money}</div>
                        <div className="activity">{item.activity}</div>
                     </div>
                      )
                    })
                   }
            </div>
        );
    }
}

export default Mylist;